# $Id: PKGBUILD 135906 2015-06-26 14:54:21Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Sebastian Wiesner <lunaryorn googlemail com>
# Contributor: Igor Ramos Tiburcio <irtigor@yahoo.com.br>
# Contributor: Wieland Hoffmann <themineo+aur@gmail.com>
# Contributor: Hervé Cauwelier <herve ¤ oursours.net>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-py
pkgname=('python-py')
pkgver=1.10.0
pkgrel=1
pkgdesc="library with cross-python path, ini-parsing, io, code, log facilities"
arch=('any')
license=('MIT')
url="https://pylib.readthedocs.io/"
depends=('python')
makedepends=('python-setuptools'
             'python-setuptools-scm')
provides=("python3-py")
replaces=("python3-py")
conflicts=("python3-py")
source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/pytest-dev/py/archive/${pkgver}.tar.gz")
sha512sums=('570f37744c95eadeebd279a6b7d5da0899d3a5ea9f4746a5d0b0d986aa3ab64c1ba3c14e8d5ad08747353270ed1ba009465e5162e6fecd7c7c7c21c69400ca4d')

prepare() {
  export LC_CTYPE=en_US.UTF-8
  export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}

build() {
  cd "${srcdir}/py-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/py-${pkgver}"
  /usr/bin/python setup.py install --root="${pkgdir}" --optimize=1
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
